//
//  ChatTableViewCell.m
//  FoodCorner
//
//  Created by apple on 16/2/26.
//  Copyright © 2016年 zhangchao. All rights reserved.
//

#import "ChatTableViewCell.h"

@implementation ChatTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self addAllViews];
    }
    return self;
}

- (void)addAllViews
{
    self.chatImageV = [[UIImageView alloc] init];
    self.chatImageV.backgroundColor = [UIColor purpleColor];
    
    self.chatLable = [[UILabel alloc] init];
    self.chatLable.backgroundColor = [UIColor lightGrayColor];
    
    self.chatDetailLable = [[UILabel alloc] init];
    self.chatDetailLable.backgroundColor = [UIColor blueColor];
    
    [self.contentView addSubview:self.chatImageV];
    [self.contentView addSubview:self.chatLable];
    [self.contentView addSubview:self.chatDetailLable];
}

- (void)layoutSubviews
{
    self.chatImageV.frame = CGRectMake(10, 10, self.contentView.frame.size.width*0.35, self.contentView.frame.size.height-20);
    self.chatLable.frame = CGRectMake(self.contentView.frame.size.width*0.4, 10, self.contentView.frame.size.width*0.6-10, (self.contentView.frame.size.height-25)/2);
    self.chatDetailLable.frame = CGRectMake(self.contentView.frame.size.width*0.4, 15+(self.contentView.frame.size.height-25)/2, self.contentView.frame.size.width*0.6-10, (self.contentView.frame.size.height-25)/2);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
